package com.vcs.frm.domain;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "STATES")
public class State {
	
	private Long stateId;
	private String stateName;
	
	/** State has a set of cities within it, so this is a one to many relationship */
	private Set<City> cities = new HashSet<City>();

	/** Default constructor required by hibernate */
	public State() {
	}

	@Id
	@Column(name = "STATE_ID")
	public Long getStateId() {
		return stateId;
	}

	public void setStateId(Long stateId) {
		this.stateId = stateId;
	}

	@Column(name = "STATE_NAME", length = 300)
	public String getStateName() {
		return stateName;
	}


	public void setStateName(String stateName) {
		this.stateName = stateName;
	}
	
	@OneToMany(mappedBy="state")
	public Set<City> getCities() {
		return cities;
	}

	public void setCities(Set<City> cities) {
		this.cities = cities;
	}
	
}
